package com.wqtz.chechai.view.activities;

import android.widget.ImageView;
import android.widget.TextView;

import com.wqtz.chechai.R;
import com.wqtz.chechai.base.BaseActivity;
import com.wqtz.chechai.presenter.BasePresent;
import com.wqtz.chechai.widget.GestureView;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 项目名称： CheChai
 * 创建人 : Liberation
 * 创建时间: 2016/12/19 9:32
 */

public class GestureSettingActivity extends BaseActivity implements GestureView.GestureCallBack {


	@BindView(R.id.iv_back)
	ImageView mIvBack;
	@BindView(R.id.tv_title)
	TextView mTvTitle;
	@BindView(R.id.body_layout)
	GestureView gestureView;

	@Override
	public void init() {
		ButterKnife.bind(this);
		gestureView.setGestureCallBack(this);
		//不调用这个方法会造成第二次启动程序直接进入手势识别而不是手势设置
		gestureView.clearCache();
		gestureView.setMinPointNums(5);
	}

	@Override
	public void loadData() {


	}

	@Override
	public int setContentViews() {
		return R.layout.activity_gesture_settings;
	}

	@Override
	public BasePresent createPresenter() {
		return null;
	}


	@OnClick(R.id.iv_back)
	public void onClick() {
	}

	@Override
	public void gestureVerifySuccessListener(int stateFlag, List<GestureView.GestureBean> data, String message, boolean success) {
		if (stateFlag == GestureView.STATE_LOGIN&&success) {
		  this.finish();
		}

	}

	@Override
	protected void onPause() {
		super.onPause();

	}

	@Override
	protected void onResume() {
		super.onResume();
		activitys.add(this); //添加当前的activity
	}
}
